package com.woniuxy.woniubookmanager.mapper;

import com.woniuxy.woniubookmanager.entity.Manager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.woniubookmanager.vo.ManagerVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 内部员工信息 Mapper 接口
 * </p>
 *
 * @author wugd
 * @since 2022-11-29 04:03:13
 */
@Mapper
public interface ManagerMapper extends BaseMapper<Manager> {

    @Update("update t_manager set user_name=#{userName},email=#{email},cellphone=#{cellphone},locked=#{locked},insert_time=#{insertTime},update_time=#{updateTime} where id = #{id} ")
    void update(ManagerVo managerVo);

    @Delete("delete from t_manager_role where manager_id = #{id}")
    void deleteManagerAndRoleOfRelationByMid(Long id);

    void saveManagerAndRoleOfRelationByMid(ManagerVo managerVo);
}
